#pragma once
#include <codec.h>
#include <vector>
class video_process
{
    public:
        int process(AVFrame* frame); //masaike process
        video_process();
        ~video_process();

    private:
        std::vector<rectangle> preprocess(AVFrame* frame);
    
        int m_target_width  = 640;
        int m_target_height = 640;      

        unsigned char* m_rgb_buffer = nullptr;
        unsigned char* m_nv12_buffer = nullptr;
        void libyuvNV12ToRGB24(unsigned char *src, unsigned char *dst, int width, int height);
        void libyuvNV12Scale(unsigned char *src,  
                unsigned char* src_uv, 
                int width,
                int height,
                unsigned char* dst,
                int out_width,
                int out_height);

};